package cn.yunhe.model;

import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.Player;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
public class Music {
    public void music() {
        try {
            String str = System.getProperty("user.dir") +"/music/music.mp3";
            BufferedInputStream bis = new BufferedInputStream(new
                    FileInputStream(str));
            Player player = new Player(bis);
            player.play();//播放⾳乐
        }catch (FileNotFoundException|JavaLayerException e) {
            e.printStackTrace();
        }
    }
}